# Maintainer: Justin Kromlinger <hashworks@archlinux.org>
pkgname=certbot-dns-hetzner
pkgdesc="Certbot plugin enabling dns-01 challenge on the Hetzner DNS API"
pkgver=2.0.0
pkgrel=2
arch=("any")
url="https://github.com/ctrlaltcoop/certbot-dns-hetzner"
license=("APACHE")
depends=("certbot" "python-requests" "python-requests-mock" 'python-tldextract' 'dns-lexicon' 'python-parsedatetime')
makedepends=("python-setuptools")
checkdepends=("python-pytest")
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=('4ac66243cb38294b1365e93f7ff4cf6e792c5fa12cdfce485e9e82b6e75a1380')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	python setup.py build
}

check() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	PYTHONPATH=. pytest
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
	python setup.py install --root="${pkgdir}" -O1 --skip-build
}
